import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)
import HomePage from '@/views/HomePage'
import ListDetail from '@/views/ListDetail'
import LookHouse from '@/views/LookHouse'
import MyName from '@/views/MyName'
import SeekMsg from '@/views/SeekMsg'
import Layout from '@/views/Layout'
const router = new VueRouter({
    routes:[
    { path: '/', redirect: '/layout' },

        {path:'/layout',component:Layout,
        redirect: '/homepage',
        children: [
          // 二级路由的规则
          { path: '/homepage', component: HomePage },
          { path: '/lookhouse', component: LookHouse },
          { path: '/seekmsg', component: SeekMsg },
          { path: '/myname', component: MyName },
        ]

    },
    {path:'/listdetail/:id',component:ListDetail}
    ],
    linkActiveClass:'active'
})
export default router
